package zmee.pur.src.formplugin;

import kd.bos.context.RequestContext;
import kd.bos.filter.FilterColumn;
import kd.bos.form.events.FilterContainerInitArgs;
import kd.bos.list.plugin.AbstractListPlugin;

import java.util.List;

/**
 * @Author: xw
 * @Date: 2023/03/03/10:01
 * @Description: 设置常用条件申请组织默认值
 */
public class SupplierRegListPlugin extends AbstractListPlugin {

    @Override
    public void filterContainerInit(FilterContainerInitArgs args) {
        super.filterContainerInit(args);
        List<FilterColumn> commonFilterColumns = args.getCommonFilterColumns();
        for (FilterColumn filterColumn : commonFilterColumns) {
            if ("zmee_applyorg.name".equals(filterColumn.getFieldName())) {
                long orgId = RequestContext.get().getOrgId();
                filterColumn.setDefaultValue(String.valueOf(orgId));
            }
        }
    }
}
